package com.kobako.controller;

import com.kobako.model.ChartDao;
import com.kobako.model.IndexChartDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by kobako on 2017/3/17.
 * Just a game
 */
@Controller
public class ChartsController {
    @Autowired
    ChartDao chartDao;
    @Autowired
    IndexChartDao indexDao;

    @RequestMapping("/")
    public String helloSpringBoot() {
        return "test/fullPage";
    }

    @RequestMapping("/index")
    public String helloIndex() {
        return "index";
    }

    @RequestMapping("/Chart")
    public String ajaxChart() {
        return "charts/showWebViews";
    }

    @RequestMapping("/getWebViews")
    @ResponseBody
    public String getWebViewsData() {
        return chartDao.getPageViewsJson();
    }

    @RequestMapping("/getIndexChart")
    @ResponseBody
    public String getIndexChart() {
        return indexDao.getIndexModel();
    }

    @RequestMapping("/bilityShow")
    public String getAbilityShow() {
        return "shows/abilityShow";
    }
}
